﻿namespace SenenFernandez.Sensktop
{
    using SenenFernandez.Sensktop.Configuration;
    using SenenFernandez.SmartExtensionMethods;

    using System;
    using System.Configuration;
    using System.Windows;
    using System.Windows.Threading;

    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        private void OnApplicationStartup(object sender, StartupEventArgs e)
        {
            if (SenenFernandez.Sensktop.Properties.Resources.ApplicationTitle.JustOneApplication())
            {
                SensktopConfiguration.Instance.Culture.SetCulture();
                var sensktopManager = new SensktopManager();
            }
        }

        private void AppDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
        {
            try
            {
                e.Exception.Show();
            }
            catch (Exception unhandledException)
            {
                unhandledException.Show();
            }
            finally
            {
                e.Handled = true;
            }
        }
    }
}